package hello;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import util.Helper;
import util.JsonPropFilter;

import data.dataprocess;

public class GetData extends HttpServlet {
	private JsonPropFilter jsonFilter = new JsonPropFilter();
	/**
	 * 
	 */
	private static final long serialVersionUID = -3122496407517358502L;

	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		String id = req.getParameter("id");
		dataprocess dp = dataprocess.getInstance();

		DataItem dataitem = dp.getData(id);
		String strJson = Helper.getObjectJSON(dataitem,jsonFilter);

		resp.getWriter().println(strJson);	
		
	}
}
